import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)
const adminHomePage = r => require.ensure([], () => r(require('@/page/admin/homePage')), 'explahomePagein');
const adminHome = r => require.ensure([], () => r(require('@/page/admin/home')), 'explahomePagein');//首页
const adminProjectIntro = r => require.ensure([], () => r(require('@/page/admin/projectIntro')), 'explahomePagein');//课题组简介
const adminMemberList = r => require.ensure([], () => r(require('@/page/admin/memberList')), 'explahomePagein');//
const adminMemberListTeacher = r => require.ensure([], () => r(require('@/page/admin/memberListTeacher')), 'explahomePagein');//组内老师
const adminMemberListStu = r => require.ensure([], () => r(require('@/page/admin/memberListStu')), 'explahomePagein');//组内学生
const adminMemberListGradute = r => require.ensure([], () => r(require('@/page/admin/memberListGradute')), 'explahomePagein');//已毕业成员
const adminTeacherDetail = r => require.ensure([], () => r(require('@/page/admin/teacherDetail')), 'explahomePagein');//老师详情
const adminResearchFindings = r => require.ensure([], () => r(require('@/page/admin/researchFindings')), 'explahomePagein');//研究成果
const adminResearchFindingsDetail = r => require.ensure([], () => r(require('@/page/admin/researchFindingsDetail')), 'explahomePagein');//研究成果详情
const adminLifeAblum = r => require.ensure([], () => r(require('@/page/admin/lifeAblum')), 'explahomePagein');//生活影集
const adminContactUs = r => require.ensure([], () => r(require('@/page/admin/contactUs')), 'explahomePagein');//联系我们
const adminInfoDetail = r => require.ensure([], () => r(require('@/page/admin/infoDetail')), 'explahomePagein');

const homePage = r => require.ensure([], () => r(require('@/page/website/homePage')), 'explahomePagein');
const home = r => require.ensure([], () => r(require('@/page/website/home')), 'explahomePagein');//首页
const projectIntro = r => require.ensure([], () => r(require('@/page/website/projectIntro')), 'explahomePagein');//课题组简介
const memberList = r => require.ensure([], () => r(require('@/page/website/memberList')), 'explahomePagein');//
const memberListTeacher = r => require.ensure([], () => r(require('@/page/website/memberListTeacher')), 'explahomePagein');//组内老师
const memberListStu = r => require.ensure([], () => r(require('@/page/website/memberListStu')), 'explahomePagein');//组内学生
const memberListGradute = r => require.ensure([], () => r(require('@/page/website/memberListGradute')), 'explahomePagein');//已毕业成员
const teacherDetail = r => require.ensure([], () => r(require('@/page/website/teacherDetail')), 'explahomePagein');//老师详情
const researchFindings = r => require.ensure([], () => r(require('@/page/website/researchFindings')), 'explahomePagein');//研究成果
const researchFindingsDetail = r => require.ensure([], () => r(require('@/page/website/researchFindingsDetail')), 'explahomePagein');//研究成果详情
const lifeAblum = r => require.ensure([], () => r(require('@/page/website/lifeAblum')), 'explahomePagein');//生活影集
const contactUs = r => require.ensure([], () => r(require('@/page/website/contactUs')), 'explahomePagein');//联系我们
const infoList = r => require.ensure([], () => r(require('@/page/website/infoList')), 'explahomePagein');//更多动态
const infoDetail = r => require.ensure([], () => r(require('@/page/website/infoDetail')), 'explahomePagein');//更多动态详情

const routes = [
    {
        path: '/',
        component: homePage,
        children:[
            {
                path: '/home',
                component: home
            },
            {
                path:'/projectIntro',
                component: projectIntro
            },
            {
                path:'/memberList',
                component: memberList,
                children:[
                    {
                        path:'/memberListTeacher',
                        component: memberListTeacher
                    },
                    {
                        path:'/memberListStu',
                        component: memberListStu
                    },
                    {
                        path:'/memberListGradute',
                        component: memberListGradute
                    },
                    {
                        path:'/teacherDetail',
                        component: teacherDetail
                    }
                ]
            },
            {
                path:'/researchFindings',
                component:researchFindings
            },
            {
                path:"/researchFindingsDetail",
                component:researchFindingsDetail
            },
            {
                path:'/lifeAblum',
                component:lifeAblum
            },
            {
                path:'/contactUs',
                component:contactUs
			},
			{
				path:'/infoList',
				component:infoList
			},
			{
				path:'/infoDetail',
				component:infoDetail
			}
        ]
    },
	{
		path: '/',
		component: adminHomePage,
		children:[
			{
				path: '/adminHome',
				component: adminHome
			},
			{
				path:'/adminProjectIntro',
				component: adminProjectIntro
			},
			{
				path:'/adminMemberList',
				component: adminMemberList,
				children:[
					{
						path:'/adminMemberListTeacher',
						component: adminMemberListTeacher
					},
					{
						path:'/adminMemberListStu',
						component: adminMemberListStu
					},
					{
						path:'/adminMemberListGradute',
						component: adminMemberListGradute
					},
					{
						path:'/adminTeacherDetail',
						component: adminTeacherDetail
					}
				]
			},
			{
				path:'/adminResearchFindings',
				component: adminResearchFindings
			},
			{
				path:"/adminResearchFindingsDetail",
				component:adminResearchFindingsDetail
			},
			{
				path:'/adminLifeAblum',
				component: adminLifeAblum
			},
			{
				path:'/adminContactUs',
				component:adminContactUs
			},
            {
                path:'/adminInfoDetail',
                component:adminInfoDetail
            }
		]
	},



]

export default new Router({
	routes,
	strict: process.env.NODE_ENV !== 'production',
})
